package com.neuedu.hisboot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.neuedu.hisboot.entity.Checktemplate;
import com.neuedu.hisboot.mapper.ChecktemplateMapper;
import com.neuedu.hisboot.service.IChecktemplateService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  病历模板管理服务实现类
 * </p>
 *
 * @author jaun
 * @since 2025-07-04
 */
@Service
public class ChecktemplateServiceImpl extends ServiceImpl<ChecktemplateMapper, Checktemplate> implements IChecktemplateService {

    @Override
    public List<Checktemplate> getByDoctorId(Integer doctorId) {
        QueryWrapper<Checktemplate> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("userID", doctorId);
        queryWrapper.eq("delMark", 1);
        return this.list(queryWrapper);
    }

    @Override
    public List<Checktemplate> getByScope(String scope) {
        QueryWrapper<Checktemplate> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("scope", scope);
        queryWrapper.eq("delMark", 1);
        return this.list(queryWrapper);
    }

    @Override
    public List<Checktemplate> getByRecordType(Integer recordType) {
        QueryWrapper<Checktemplate> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("recordType", recordType);
        queryWrapper.eq("delMark", 1);
        return this.list(queryWrapper);
    }

    @Override
    public List<Checktemplate> searchByName(String name) {
        QueryWrapper<Checktemplate> queryWrapper = new QueryWrapper<>();
        queryWrapper.like("name", name);
        queryWrapper.eq("delMark", 1);
        return this.list(queryWrapper);
    }
}
